#ifndef Md873d82af384423290d0039250993078
#define Md873d82af384423290d0039250993078
/**
 *   Copyright (c) Rich Hickey. All rights reserved.
 *   The use and distribution terms for this software are covered by the
 *   Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
 *   which can be found in the file epl-v10.html at the root of this distribution.
 *   By using this software in any fashion, you are agreeing to be bound by
 * 	 the terms of this license.
 *   You must not remove this notice, or any other, from this software.
 **/

/**
 *   Author: Timothy Baldridge
 **/
class CjObject;
class IFn;
namespace clojure_lang
{
    /// <summary>
    /// Represents a collection that supports function mapping/reduction.
    /// </summary>
    class IReduce
    {
        /// <summary>
        /// Reduce the collection using a function.
        /// </summary>
        /// <param name="f">The function to apply.</param>
        /// <returns>The reduced value</returns>
        /// <remarks>Computes f(...f(f(f(i0,i1),i2),i3),...).</remarks>
        virtual CjObject *reduce(IFn f) = 0;


        /// <summary>
        /// Reduce the collection using a function.
        /// </summary>
        /// <param name="f">The function to apply.</param>
        /// <param name="start">An initial value to get started.</param>
        /// <returns>The reduced value</returns>
        /// <remarks>Computes f(...f(f(f(start,i0),i1),i2),...).</remarks>
        virtual CjObject *reduce(IFn f, CjObject start) = 0;
    };
}
Q_DECLARE_INTERFACE(clojure_lang::IReduce, "clojure.lang.IReduce/1.0")

#endif
